package net.pm.core.entities.db;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import net.pm.core.entities.PMCommandEntity;

import org.hibernate.annotations.GenericGenerator;

/**
 * The persistent class for the orderinfolog database table. 订单改变记录
 */
@Entity
@Table(name = "orderinfolog")
public class Orderinfolog extends PMCommandEntity<Orderinfolog> {
	
	private static final long serialVersionUID = -3277284952182045528L;
	private String id;
	private Date operationTime;
	private String remark;
	private Short status;
	private Orderinfo orderinfo;
	private Pmuser user;

	public Orderinfolog() {
	}

	public Orderinfolog(String id) {
		super();
		this.id = id;
	}

	@GenericGenerator(name = "generator", strategy = "org.hibernate.id.UUIDGenerator")
	@Id
	@GeneratedValue(generator = "generator")
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(nullable = false)
	public Date getOperationTime() {
		return this.operationTime;
	}

	public void setOperationTime(Date operationTime) {
		this.operationTime = operationTime;
	}

	@Column(length = 500)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(nullable = false)
	public Short getStatus() {
		return this.status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}

	// bi-directional many-to-one association to Orderinfo
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "OrderId", nullable = false)
	public Orderinfo getOrderinfo() {
		return this.orderinfo;
	}

	public void setOrderinfo(Orderinfo orderinfo) {
		this.orderinfo = orderinfo;
	}
	
	// bi-directional many-to-one association to Pmuser
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UserId")
	public Pmuser getUser() {
		return user;
	}

	public void setUser(Pmuser user) {
		this.user = user;
	}

	@Override
	public int compareTo(Orderinfolog o) {
		// TODO Auto-generated method stub
		return 0;
	}

}